from urllib.parse import urljoin
from pathlib import Path


class Settings:
    schema = 'https'
    host = 'lgqm.gq'
    api_path = '/api/mobile/'
    plugin_path = '/plugin.php'
    data_dir = Path('./data')
    login_params = {
        'module': 'login',
        'type': 'login',
    }
    limit_snum = 500
    limit_strength = 40

    @property
    def server(self):
        return f'{self.schema}://{self.host}/'

    @property
    def api(self):
        return urljoin(self.server, self.api_path)

    @property
    def plugin(self):
        return urljoin(self.server, self.plugin_path)

    @property
    def users_path(self):
        return self.data_dir.joinpath('users.json')

    @property
    def users_path2(self):
        return self.data_dir.joinpath('users2.json')


default_settings = Settings()
